{%TEMPLATE->struct/head%}
{%TEMPLATE->struct/menu%}
<h2>Cracker Binaries</h2>
{%TEMPLATE->struct/messages%}
<div class="card">
  <div class="table-responsive">
    <table class="table table-bordered">
		  <tr>
			  <th>Binary Type ID</th>
			  <th>Name</th>
			  <th>Available Versions</th>
			  <th>Action</th>
		  </tr>
		  {{FOREACH binaryType;[[binaryTypes]]}}
			  <tr>
				  <td><a href="crackers.php?id=[[binaryType.getId()]]">[[binaryType.getId()]]</a></td>
				  <td><a href="crackers.php?id=[[binaryType.getId()]]">[[htmlentities([[binaryType.getTypeName()]], ENT_QUOTES, "UTF-8")]]</a></td>
				  <td>[[versions.getVal([[binaryType.getId()]])]]</td>
				  <td>
					  {{IF [[accessControl.hasPermission([[$DAccessControl::CRACKER_BINARY_ACCESS]])]]}}
						  <div style='float: left; padding-right: 5px;'>
							  <a class='btn btn-primary' href="crackers.php?id=[[binaryType.getId()]]&new=true">Add Version/Binary</a>
						  </div>
						  <form style="float: left;" action="crackers.php" method="POST" onSubmit="if (!confirm('Really delete binary type [[htmlentities([[binaryType.getTypeName()]], ENT_QUOTES, 'UTF-8')]]?')) return false;">
							  <input type="hidden" name="action" value="[[$DCrackerBinaryAction::DELETE_BINARY_TYPE]]">
							  <input type="hidden" name="binaryTypeId" value="[[binaryType.getId()]]">
							  <input type="hidden" name="csrf" value="[[csrf]]">
                <button type="submit" class='btn btn-danger' data-toggle="tooltip" data-placement="top" title="Delete"><i class="fas fa-trash" aria-hidden="true"></i></button>
						  </form>
					  {{ENDIF}}
				  </td>
			  </tr>
		  {{ENDFOREACH}}
	  </table>
  </div>
</div>
{%TEMPLATE->struct/foot%}